<template>
  <div class="screen-load-more" :style="{visibility: loadMoreVisible ? 'visible' : 'hidden'}">
    <div class="loading-img" v-if="loadMoreType === 'loading'">
      <img src="../../assets/images/loading.gif" alt="菊花图" />
    </div>
    <div class="loading-tip" v-if="loadMoreType === 'loading'">加载中...</div>
    <div class="none-tip" v-if="loadMoreType === 'none'">没有更多了~</div>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator'
enum LoadMoreType {
  none = 'none',
  loading = 'loading',
}
@Component({
  name: 'screen-load-more'
})

export default class ScreenLoadMore extends Vue {
  @Prop({ default: false }) loadMoreVisible!: boolean
  @Prop({ default: LoadMoreType.none }) loadMoreType!: LoadMoreType
}
</script>

<style lang="scss" scoped>
img {
  width: 100%;
  height: 100%;
  float: left;
}
.screen-load-more {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  .loading-img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
  }
  .loading-tip {
    font-family: 'PingFang Regular';
    font-size: 16px;
    color: rgba(255, 255, 255, 0.67);
  }
  .none-tip {
    font-family: 'PingFang Regular';
    font-size: 16px;
    color: rgba(255, 255, 255, 0.67);
  }
}
</style>
